<?php

namespace Library\Support;


use Library\Logger;

class Log
{
    /**
     *
     */
    public function __construct()
    {

    }

    /**
     * @param mixed $message
     * @param array|object $context
     * @return void
     */
    public static function info(mixed $message, array|object $context = []): void
    {
        $message = match (true){
            is_object($message)||is_array($message) => json_encode($message,JSON_UNESCAPED_UNICODE),
            default => $message
        };
        $context = match (true){
            is_object($context) => json_decode(json_encode($context,JSON_UNESCAPED_UNICODE),true),
            default => $context
        };

        Logger::make()->info($message,$context);
    }
}